/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CompanyExtManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class ChangeMaxNotConatctDay extends AbstractAction
/*    */ {
/*    */   public ChangeMaxNotConatctDay(AbstractHttpServlet servlet)
/*    */   {
/* 23 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 29 */     response.setContentType("text/html;charset=utf-8");
/* 30 */     PrintWriter out = response.getWriter();
/* 31 */     JSONObject jsonObject = new JSONObject();
/*    */ 
/* 33 */     String maxNotContactDay = Util.getURLParameter(request
/* 34 */       .getParameter("maxNotContactDay"));
/*    */ 
/* 36 */     String categoryIds = Util.getURLParameter(request
/* 37 */       .getParameter("categoryIds"));
/*    */ 
/* 39 */     if ((categoryIds == null) || (categoryIds.length() == 0)) {
/* 40 */       categoryIds = "*";
/*    */     }
/*    */ 
/* 43 */     if (categoryIds.indexOf("*") >= 0) {
/* 44 */       categoryIds = "*";
/*    */     }
/*    */ 
/* 48 */     if ((maxNotContactDay == null) || (maxNotContactDay.length() == 0)) {
/* 49 */       maxNotContactDay = 
/* 50 */         String.valueOf(0);
/*    */     }
/*    */ 
/* 53 */     User u = super.getLoginUser(request);
/* 54 */     CompanyExtManager manager = new CompanyExtManager();
/*    */ 
/* 57 */     if ("0".equals(maxNotContactDay))
/*    */     {
/* 59 */       manager.update(1, "0", 
/* 60 */         u.companyId, u.userId);
/*    */     }
/* 62 */     else manager.update(1, 
/* 63 */         maxNotContactDay + "_" + categoryIds, u.companyId, u.userId);
/*    */ 
/* 66 */     jsonObject.put("error", "0");
/* 67 */     out.println(jsonObject);
/* 68 */     out.flush();
/* 69 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ChangeMaxNotConatctDay
 * JD-Core Version:    0.6.1
 */